/// <reference path="_variables-shared.scss" />
/// <reference path="_mixins.scss" />
/// <reference path="../lib/bs4/scss/bootstrap.scss" />

//
// Choice Styles (Variants etc.)
// ------------------------------------------------------

.choice {
    margin-bottom: 1rem;
}

.col-form-label.required,
.choice-label.required {
	color: inherit;
	font-weight: bold;
	&:after { content: ' *' }
}

.choice-item {
    display: inline-flex;
    align-items: center;
}

.choice-item-unavailable {
    color: $text-muted;
}

.choice-item-img,
.choice-item-color {
    display: inline-block;
    text-decoration: none !important;
    margin-right: 0.4rem;
    overflow: hidden;
}

.choice-item-img {
    max-height: 1em;
    width: 1.25em;

    > img {
        max-width: 100%;
        height: auto;
        display: inherit;
    }
}

.choice-item-color {
    width: 1em;
    height: 1em;
    padding: 0;
}

.choice-description {
    color: $text-muted;
    font-size: $font-size-sm;
    margin-bottom: 0.5rem;
    > *:first-child { margin-top: 0; }
    > *:last-child { margin-bottom: 0; }
}

.choice-box-group {
    $choice-box-padding:        3px;
    $choice-box-size:           2.8rem;
    $choice-box-size-lg:        4rem;
    $choice-box-size-sm:        2.3rem;
    $choice-box-size-xl:        6rem;

	margin: 0;
	padding: 0;
	list-style-type: none;
    position: relative;
    margin: 0 ($choice-box-padding * -1);

    @include clearfix();

	.choice-box {
        position: relative;
        float: left;
        display: block;
        padding: $choice-box-padding;
	}

    .choice-box-label {
        margin: 0;
    }

	.choice-box-content {
        position: relative;
		display: block;
        cursor: pointer;

        &:after {
            box-sizing: content-box;
            position: absolute;
            display: block;
            right: -6px;
            top: -6px;
            background-color: $warning;
            border-radius: 50%;
            border: 1px solid #fff;

            width: 16px;
            height: 16px;
            line-height: 16px;
            text-align: center;
            vertical-align: middle;

            @include fontawesome-font("\f00c", regular); // check
            color: #fff;
            font-size: 10px;

            opacity: 0;
            transform: scale(0);
            transition: all 0.1s ease-in;
        }
	}

	.choice-box-element {
        display: inline-block;
        border: 1px solid rgba(0,0,0, .15);
        border-radius: $border-radius;
        background-color: #fff;

        height: $choice-box-size;
        line-height: $choice-box-size;
        min-width: $choice-box-size;
        vertical-align: middle;
        text-align: center;
        overflow: hidden;
        font-weight: $font-weight-medium;

        background-size: cover;
        background-repeat: no-repeat;
        background-position: 50% 50%;

        &:hover { border-color: rgba(0,0,0, 0.5); }

        .choice-box-text {
            padding: 0 0.4rem;
        }
	}

    .choice-box-image-unavailable {
        opacity: .5;
        border: 1px dashed rgba(0,0,0, .3);
    }

    .choice-box-color-unavailable {
        border: 1px dashed rgba(0,0,0, .7);

/*        &:after {
            display: block;
            position: absolute;
            content: "";
            background: rgba(0,0,0, 0.3);
            transform: rotate(-56deg);
            width: 50px;    //62px;
            height: 1px;
            left: -20px;
            right: -20px;
            top: 0;
            bottom: 0;
            margin: auto;
        }*/
    }

    .choice-box-disabled {
        opacity: .5;
    }

    .choice-box-mediafile .choice-box-content {
        max-width: $choice-box-size-xl !important;

        .file-img {
            object-fit: contain;
            max-width: 100%
        }
    }

	.choice-box-control-native:checked + .choice-box-content {
        .choice-box-element {
            border-color: rgba(#000, 0.4);
            box-shadow: 0 0 5px #aaa;
        }

        &:after {
            opacity: 1;
            transform: scale(1);
        }
	}

	.choice-box-control-native {
		display: none !important;
	}

    // Choice box sizing
    &.choice-box-group-xl .choice-box-element {
        height: $choice-box-size-xl;
        line-height: $choice-box-size-xl;
        min-width: $choice-box-size-xl;     
    }

    &.choice-box-group-lg .choice-box-element {
        height: $choice-box-size-lg;
        line-height: $choice-box-size-lg;
        min-width: $choice-box-size-lg;       
    }

    &.choice-box-group-sm .choice-box-element {
        height: $choice-box-size-sm;
        line-height: $choice-box-size-sm;
        min-width: $choice-box-size-sm;       
    }
}